<!-- 展示框 -->
<template>
  <div class="displayBox-container">
    <div
      class="item"
      :style="{ width: `${width}px`, height: `${height}px` }"
      v-for="(item, index) in content"
      :key="index"
      v-loadings="Loading"
    >
      <BackgroundBox :background="backgroundColor" :border="BoxBorder" >
        <div class="subject">
          <div class="icon" :style="{color:item.IconColor,fontSize:`${IconSize}em`}">
            <Icon :type="item.Icon"></Icon>
          </div>
          <div class="main">
            <p class="title">{{ item.title }}</p>
            <p class="text">{{ item.text || "暂无" }}</p>
          </div>
        </div>
      </BackgroundBox>
    </div>
  </div>
</template>

<script setup>
import Icon from "../Icon/index.vue";
import BackgroundBox from "../BackgroundBox/index.vue";
const props = defineProps({
  content: {
    type: Array,
    reqiured: true,
  },
  // 展示框的宽度
  width: {
    type: Number,
    default: 250,
  },
  // 展示框的高度
  height: {
    type: Number,
    default: 100,
  },
  // 背景
  backgroundColor: {
    type: String,
  },
  // 边框
  BoxBorder: {
    type: String,
  },
  // 图标大小
  IconSize:{
    type:Number,
    default: 4
  },
  Loading:{
    type:Boolean,
    default:false
  }
});
</script>

<style lang="less" scoped>
.displayBox-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  .item{
    position: relative;
    margin: 10px 0;
  }
  .subject {
    width: 100%;
    height: 100%;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .main {
      width: 100%;
      height: 80%;
      text-align: right;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .title {
        font-size: 1em;
        font-weight: bold;
      }
      .text {
        font-size: 1.2em;
      }
    }
  }
}
</style>